#pragma once
#include "defs.h"
#include "matrix.h"

namespace vivid
{
    class Vector;
    class Point;
    class Normal;

	class Transform
	{
	public:
		Transform();
		Transform(Transform const & aT);
		Transform(Matrix const & aM);
        Transform(Matrix const & aM, Matrix const & aInv);

		bool operator == (Transform const &aT) const;
		bool operator != (Transform const &aT) const;

		Transform operator *(Transform const & aT) const;
		Point operator *(Point const &aP) const;
		Vector operator *(Vector const &aV) const;
		Normal operator *(Normal const &aN) const;

		Transform GetInverse() const;
		Transform GetTranspose() const;

		static Transform Identity();
		static Transform Translate(VFloat aX, VFloat aY, VFloat aZ);
		static Transform Scale(VFloat aX, VFloat aY, VFloat aZ);
		static Transform RotateX(VFloat aAng);
		static Transform RotateY(VFloat aAng);
		static Transform RotateZ(VFloat aAng);
		static Transform Rotate(VFloat aAng, Vector const & aAxis);
		static Transform LookAt(Point const & aPos, Point const & aLook, Vector const & aUp);

	protected:
		Matrix _m;
		Matrix _mInv;
	}
};